package com.example.core

import android.app.Application
import android.content.Context

/**
 * Created by MajinBuu on 2021/2/7 0007.
 * @desc .
 */
class BaseApplication : Application() {
    companion object {
        @JvmStatic
        @get:JvmName("currentApplication")//在java中可通过BaseApplication.currentApplication调用
        lateinit var currentApplication: Context
            private set//外界不可替换值
    }

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        currentApplication = this@BaseApplication
    }
}